<?php echo $this->Session->flash(); ?>
<div id="loading" style="display: none;">
    <?php echo $html->image('loading.gif', array('border' => "0", 'align' => 'center')); ?>
</div>
<h1>GASTO NOTARIAL</h1>
<table id="tabla">
    <thead>
        <tr>
            <th>Id</th>
            <th>Valor</th>
            <th>Calificación Total</th>
            <th>Observación Total</th>
            <th colspan ="2">Acciones</th>
        </tr>
    </thead>
    <tbody>     
        <?php $editar = true ?>
        <?php foreach ($ExpenseNotarials as $ExpenseNotarial): ?>
            <tr>
                <td><?php echo $ExpenseNotarial['ExpenseNotarial']['id'] ?></td>
                <td><?php
        if (!is_numeric($ExpenseNotarial['ExpenseNotarial']['valor'])) {
            echo '$ ' . number_format(0, 2, ',', '.');
        } else {
            echo '$ ' . number_format($ExpenseNotarial['ExpenseNotarial']['valor'], 2, ',', '.');
        }
            ?></td>
                <td><?php echo $ExpenseNotarial['ExpenseNotarial']['calificacion_total'] ?></td>
                <td><?php echo substr($ExpenseNotarial['ExpenseNotarial']['observacion_total'], 0, 200) . "..." ?></td>
                <td>
                    <?php
                    echo $ajax->link('Editar', array('controller' => 'ExpenseNotarials', 'action' => 'edit', $ExpenseNotarial['ExpenseNotarial']['id']), array('class' => 'actions', 'update' => 'content', 'indicator' => 'loading', 'escape' => false));
                    echo "<br>";
                    echo "<br>";
                    echo $ajax->link('Ver_Observaciones', array('controller' => 'ExpenseNotarials', 'action' => 'qualify_view', $ExpenseNotarial['ExpenseNotarial']['id']), array('class' => 'actions', 'update' => 'content', 'indicator' => 'loading', 'escape' => false));
                    echo "<br>";
                    echo "<br>";
                    echo $ajax->link('Calificar', array('controller' => 'ExpenseNotarials', 'action' => 'qualify', $ExpenseNotarial['ExpenseNotarial']['id']), array('class' => 'actions', 'update' => 'content', 'indicator' => 'loading', 'escape' => false));
                    ?>
                    <?php
                    echo "<br>";
                    echo "<br>";
                    echo $ajax->link('Proyecto_productivo', array('controller' => 'ProyectCheckLists', 'action' => 'index', $ExpenseNotarial['ExpenseNotarial']['id']), array('class' => 'actions', 'update' => 'content', 'indicator' => 'loading', 'escape' => false));
                    ?>
                     <br>
                     <br>
                     <?php echo $this->Html->link('Certificación', array('action' => 'print_certification',$ExpenseNotarial['ExpenseNotarial']['id'], 'controller' => 'ExpenseNotarials'), array('target' => '_blank','class'=> 'actions')) ?> 

                </td>
            </tr>
        <?php endforeach; ?>
    </tbody>
</table>
<br>
<?php
if (empty($ExpenseNotarials))
    echo $ajax->link('Adicionar ', array('controller' => 'ExpenseNotarials', 'action' => 'add', $proyect_id), array('class' => 'actions', 'update' => 'content', 'indicator' => 'loading', 'escape' => false), "¿Desea agregar un nuevo gasto notarial?, Una vez agregado aparecerá en la lista, desde allí podrá modificarlo.");
?>
<br><br><br>
